package com.hdugraduate;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class ViewResultMore extends Activity{
	private TextView viewName;
	private TextView viewGps;
	private TextView viewPhone;
	private TextView viewAddr;
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Bundle viewResultMore = this.getIntent().getExtras();
		String bufferResult = viewResultMore.getString("result");
		
		//Get name
		int signStartOne = 0;
		int signEndOne = 0;
		signStartOne = bufferResult.indexOf("<", signEndOne);
		signEndOne = bufferResult.indexOf(">",signEndOne);
		String nameOne = bufferResult.substring(signStartOne+1, signEndOne-1);
		
		// get Gps x
		signStartOne = bufferResult.indexOf("<", signEndOne+1);
		signEndOne = bufferResult.indexOf(">",signEndOne+1);
		String gpsxOne = bufferResult.substring(signStartOne+1, signEndOne-1);
		
		// get Gps y
		signStartOne = bufferResult.indexOf("<", signEndOne+1);
		signEndOne = bufferResult.indexOf(">",signEndOne+1);
		String gpsyOne = bufferResult.substring(signStartOne+1, signEndOne-1);
		
		// get Phone
		signStartOne = bufferResult.indexOf("<", signEndOne+1);
		signEndOne = bufferResult.indexOf(">",signEndOne+1);
		String phoneOne = bufferResult.substring(signStartOne+1, signEndOne-1);
		
		// get address
		signStartOne = bufferResult.indexOf("<", signEndOne+1);
		signEndOne = bufferResult.indexOf(">",signEndOne+1);
		String addrOne = bufferResult.substring(signStartOne+1, signEndOne-1);
		
		setContentView(R.layout.resultviewone);
		viewName = (TextView)findViewById(R.id.resultname);
		viewGps = (TextView)findViewById(R.id.resultgps);
		viewPhone = (TextView)findViewById(R.id.resultphone);
		viewAddr = (TextView)findViewById(R.id.resultaddr);
		viewName.setText("Name: "+nameOne);
		viewGps.setText("GpsLocation: "+gpsxOne+","+gpsyOne);
		viewPhone.setText("CALL:"+phoneOne);
		viewAddr.setText("ADDR:"+addrOne);
	}
}
